﻿@model SCMS.UI.Models.SalaryPaymentItems
@{AjaxOptions ajaxOpts = new AjaxOptions
      {
          UpdateTargetId = "SPItemDiv",
          LoadingElementId = "loading",
          HttpMethod = "Post",
          Url = Url.Action("SaveSPItem/" + ViewBag.SPID),
          OnBegin = "checkBalance",
          OnSuccess = "usermsgg",
          OnFailure = "javascript:errormsg()"
      };}

<script src="@Url.Content("~/Scripts/js/general.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/ajax.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
{
    @Html.ValidationSummary(true)
    <input type="hidden" id="currencyId"  value="@ViewBag.CurrencyId" />
    <fieldset>
        <table>
            <tr>
                <td align="right" valign="top" class="editor-label">
                    Item Name:
                </td>
                <td align="left" class="editor-field">
                    @Html.DropDownListFor(model => model.EntitySalaryPBL.PayrollItemId, Model.Items, "---Please Select---")
                    @Html.ValidationMessageFor(model => model.EntitySalaryPBL.PayrollItemId)
                </td>
            </tr>
            <tr>
                <td align="right" valign="top" class="editor-label">
                    Amount:
                </td>
                <td align="left" class="editor-field">
                    @Html.TextBoxFor(model => model.EntitySalaryPBL.Amount, new { id = "TotalPrice" })
                    @Html.ValidationMessageFor(model => model.EntitySalaryPBL.Amount)
                </td>
            </tr>
            <tr>
                <td align="right" valign="top" class="editor-label">
                    Project No:
                </td>
                <td align="left" class="editor-field">
                    @Html.DropDownListFor(model => model.ProjectDonorId, Model.ProjectNos, "---Please Select---", new { @id = "dplProjectNo", onchange = "javascript:selectedIndexChange4SP(this)" })
                    @Html.ValidationMessageFor(model => model.ProjectDonorId)
                </td>
            </tr>
            <tr>
                <td align="right" valign="top" class="editor-label">
                    Budget Line:
                </td>
                <td align="left" class="editor-field">
                    <div id="PBlines">
                        @Html.DropDownListFor(model => model.EntitySalaryPBL.BudgetLineId, Model.BudgetLines, "---Please Select---", new { @class = "dpl", @id = "BudgetLineID", onchange = "javascript:checkBalance()" })
                        @Html.ValidationMessageFor(model => model.EntitySalaryPBL.BudgetLineId)
                    </div>
                </td>
            </tr>
            <tr>
                <td align="left" class="editor-field">
                </td>
                <td align="left" class="editor-label" colspan="2" id="fundsCheck" valign="top">
                </td>
            </tr>
        </table>
        <p>
            <input type="submit" class="btn green"  value="@ViewBag.Action" />&nbsp;
            <input type="button" class="btn green" value="Cancel" onclick="javascript:CloseDialog()" />
        </p>
    </fieldset>
}